/*
 * @Author: lizuoxian
 * @Date: 2023-03-17 16:30:24
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2023-06-13 15:35:30
 * @FilePath: /wx-app-h5/vite.config.js
 * @Description:
 */
import { createVuePlugin } from 'vite-plugin-vue2'
// import Components from 'unplugin-vue-components/vite'
import path from 'path'

export default {
  plugins: [
    createVuePlugin(),
    // Components({
    //   resolvers: [],
    // }),
  ],
  resolve: {
    // 路径相关配置项
    alias: [
      // 文件别名配置
      {
        find: '@',
        replacement: path.resolve(__dirname, 'src'),
      },
      {
        find: 'api',
        replacement: path.resolve(__dirname, 'src/api/module'),
      },
    ],
  },
  server: {
    port: 9999,
    host: '0.0.0.0',
    proxy: {
      '/face': {
        // target: 'https://wxsit.e-guofu.com/wxcxapp/face',
        // target: 'http://192.168.200.182:8018',
        target: 'http://81.70.149.205:8060/manage',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/face/, ''),
      },
      '/gwface': {
        target: 'https://wxsit.e-guofu.com/face',
        // target: 'http://192.168.200.250:8010',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/gwface/, ''),
      },
      '/easyreplay': {
        target: 'https://wxsit.e-guofu.com/wxcxapp/easyreplay',
        // target: 'http://192.168.200.250:8010',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/easyreplay/, ''),
      },
    },
  },
  base: './',
  build: {
    outDir: 'sino-wechat',
  },
}
